//
//  KKFileManager.h
//  GCDDemo
//
//  Created by 程强 on 16/7/5.
//  Copyright © 2016年 程强. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface KKFileManager : NSObject
+ (NSString *)createFileWithName:(NSString *)fileName;
/**
 *  写入沙盒document
 *
 *  @param object 数据对象
 *  @param path   文件路径
 *
 *  @return 成功失败
 */
+ (BOOL)saveObject:(id)object withPath:(NSString *)path;
+ (BOOL)saveObject:(id)object withName:(NSString *)name;
/**
 *  存入NSUserDefault
 *
 *  @param object 数据对象
 *  @param key    key
 *
 *  @return 成功失败
 */
+ (BOOL)setUserDefaultObject:(id)object forKey:(NSString *)key;
/**
 *  取NSUserDefault对象
 *
 *  @param key key
 *
 *  @return 数据对象
 */
+ (id)userDefaultObjectForKey:(NSString *)key;
/**
 *  归档
 *
 *  @param object 数据对象<字符串、数字、NSArray、NSDictionary>
 *  @param path   文件路径
 *
 *  @return 成功失败
 */
+ (BOOL)arichiverObject:(id)object toFile:(NSString *)path;
+ (id)unarchiverObjectWithFile:(NSString *)path;
@end
